//! 日期时间工具库
use chrono::{Local, TimeZone, Utc};

/// 获取当前时间戳
#[allow(dead_code)]
pub fn get_local_timestamp() -> i64 {
    Local::now().timestamp_millis()
}

/// 获取当前时间UTC格式字符串
#[allow(dead_code)]
pub fn get_now_to_rfc2822() -> String {
    Utc::now().to_rfc2822()
}

/// 返回计算后的UTC格式
pub fn set_timestamp_string(millis: i32) -> String {
    let millis = get_local_timestamp() + millis as i64;
    Utc.timestamp_millis(millis).to_rfc2822()
}
